<?php
class mysql_con
{
	private $url='127.0.0.1';
	private $usrname='blog';
	private $passwd='d3621201,';
	private $database='blog';
	private $db;
	private $res;
	function __construct()
	{
		$this->db=new mysqli($this->url,$this->usrname,$this->passwd,$this->database);
		if(mysqli_connect_errno())
		{
			echo 'can not connect the database';
		}
	}
	function list_post($query)
	{
		$res=$this->db->query($query);
		$res=$res->fetch_all();
		return $res;
	}
}
?>


